package com.peach.service.impl;

import com.peach.mapper.ActivityMapper;
import com.peach.pojo.Activity;
import com.peach.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Service
public class ActivityServiceImpl implements ActivityService {

    @Autowired
    private ActivityMapper activityMapper;


    @Override
    public List<Activity> selectAllActivities(String activityAuthor, String activityContent) {
        return activityMapper.selectAllActivities(activityAuthor,activityContent);
    }

    @Override
    public Boolean updateOneActivity(Activity activity) {
        return activityMapper.updateOneActivity(activity);
    }

    @Override
    public Boolean deleteOneActivity(Integer activityId) {
        return activityMapper.deleteOneActivity(activityId);
    }

    @Override
    public Boolean insertOneActivity(Activity activity) {
        return activityMapper.insertOneActivity(activity);
    }

    @Override
    public List<Activity> selectAllActivitiesByUser(Integer activityUserId) {
        return activityMapper.selectAllActivitiesByUser(activityUserId);
    }

    @Override
    public Activity selectActivityById(Integer activityId) {
        return activityMapper.selectActivityById(activityId);
    }

    @Override
    public Boolean updateActivityState0_1(Integer activityId,Integer activityUserId) {
        return activityMapper.updateActivityState0_1(activityId,activityUserId);
    }

    @Override
    public Boolean updateActivityState1_2(Integer activityId) {
        return activityMapper.updateActivityState1_2(activityId);
    }

}
